package com.ruoyi.suggestion.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.suggestion.mapper.CommunityCategoryMapper;
import com.ruoyi.suggestion.domain.CommunityCategory;
import com.ruoyi.suggestion.service.ICommunityCategoryService;

/**
 * 建议分类Service业务层处理
 * 
 * @author xianyu
 * @date 2025-04-02
 */
@Service
public class CommunityCategoryServiceImpl implements ICommunityCategoryService 
{
    @Autowired
    private CommunityCategoryMapper communityCategoryMapper;

    /**
     * 查询建议分类
     * 
     * @param id 建议分类主键
     * @return 建议分类
     */
    @Override
    public CommunityCategory selectCommunityCategoryById(Long id)
    {
        return communityCategoryMapper.selectCommunityCategoryById(id);
    }

    /**
     * 查询建议分类列表
     * 
     * @param communityCategory 建议分类
     * @return 建议分类
     */
    @Override
    public List<CommunityCategory> selectCommunityCategoryList(CommunityCategory communityCategory)
    {
        return communityCategoryMapper.selectCommunityCategoryList(communityCategory);
    }

    /**
     * 新增建议分类
     * 
     * @param communityCategory 建议分类
     * @return 结果
     */
    @Override
    public int insertCommunityCategory(CommunityCategory communityCategory)
    {
        communityCategory.setCreateTime(DateUtils.getNowDate());
        return communityCategoryMapper.insertCommunityCategory(communityCategory);
    }

    /**
     * 修改建议分类
     * 
     * @param communityCategory 建议分类
     * @return 结果
     */
    @Override
    public int updateCommunityCategory(CommunityCategory communityCategory)
    {
        return communityCategoryMapper.updateCommunityCategory(communityCategory);
    }

    /**
     * 批量删除建议分类
     * 
     * @param ids 需要删除的建议分类主键
     * @return 结果
     */
    @Override
    public int deleteCommunityCategoryByIds(Long[] ids)
    {
        return communityCategoryMapper.deleteCommunityCategoryByIds(ids);
    }

    /**
     * 删除建议分类信息
     * 
     * @param id 建议分类主键
     * @return 结果
     */
    @Override
    public int deleteCommunityCategoryById(Long id)
    {
        return communityCategoryMapper.deleteCommunityCategoryById(id);
    }
}
